home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / PC Card Manager / CIncludes / ATA.h next >
Encoding:
C/C++ Source or Header  |  1996-11-25  |  52.7 KB  |  1,033 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ATA.h
  3.  
  4.      Contains:    ATA (PC/AT Attachment) Interfaces
  5.  
  6.      Version:    System 7.5
  7.  
  8.      DRI:        Dennis Pak
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            System Seven Interfaces Daemon
  17.                  With Interfacer:    2.0d11   (PowerPC native)
  18.                  From:                ATA.i
  19.                      Revision:        15
  20.                      Dated:            7/13/96
  21.                      Last change by:    KS
  22.                      Last comment:    Added kATATaskTimeRequest to allow the ATAManager (4.0) to
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __ATA__
  29. #define __ATA__
  30.  
  31. #ifndef __TYPES__
  32. #include <Types.h>
  33. #endif
  34. #ifndef __MIXEDMODE__
  35. #include <MixedMode.h>
  36. #endif
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42. #if PRAGMA_IMPORT_SUPPORTED
  43. #pragma import on
  44. #endif
  45.  
  46. #if PRAGMA_ALIGN_SUPPORTED
  47. #pragma options align=mac68k
  48. #endif
  49.  
  50. #if FOR_SYSTEM7_ONLY
  51. /* This is the structure used for the AT Interface core routines below */
  52.  
  53. enum {
  54.     kATATrap                    = 0xAAF1,                        /* Manager trap number <This should be defined in Traps.h>*/
  55.     kATAPBVers1                    = 0x01,                            /* parameter block version number 1*/
  56.     kATAPBVers2                    = 0x02,                            /* parameter block version number for structures*/
  57.     kATAPBVers3                    = 0x03,                            /* parameter block version for ATA times*/
  58.     kATADefaultBlockSize        = 512                            /* default block size*/
  59. };
  60.  
  61. /* Used to determine the presence of traps*/
  62.  
  63. enum {
  64.     kFSMTrap                    = 0xAC,
  65.     mDQEChanged                    = 1                                /* DQE has changed */
  66. };
  67.  
  68. /* Task file definition ••• Error Register •••*/
  69.  
  70. enum {
  71.     bATABadBlock                = 7,                            /* bit number of bad block error bit*/
  72.     bATAUncorrectable            = 6,                            /* bit number of uncorrectable error bit*/
  73.     bATAMediaChanged            = 5,                            /* bit number of media changed indicator*/
  74.     bATAIDNotFound                = 4,                            /* bit number of ID not found error bit*/
  75.     bATAMediaChangeReq            = 3,                            /* bit number of media changed request*/
  76.     bATACommandAborted            = 2,                            /* bit number of command abort bit*/
  77.     bATATrack0NotFound            = 1,                            /* bit number of track not found*/
  78.     bATAAddressNotFound            = 0,                            /* bit number of address mark not found*/
  79.     mATABadBlock                = 1 << bATABadBlock,            /* Bad Block Detected*/
  80.     mATAUncorrectable            = 1 << bATAUncorrectable,        /* Uncorrectable Data Error*/
  81.     mATAMediaChanged            = 1 << bATAMediaChanged,        /* Media Changed Indicator (for removable)*/
  82.     mATAIDNotFound                = 1 << bATAIDNotFound,            /* ID Not Found*/
  83.     mATAMediaChangeReq            = 1 << bATAMediaChangeReq,        /* Media Change Requested (NOT IMPLEMENTED)*/
  84.     mATACommandAborted            = 1 << bATACommandAborted,        /* Aborted Command*/
  85.     mATATrack0NotFound            = 1 << bATATrack0NotFound,        /* Track 0 Not Found*/
  86.     mATAAddressNotFound            = 1 << bATAAddressNotFound        /* Address Mark Not Found*/
  87. };
  88.  
  89. /* Task file definition ••• ataTFSDH Register •••*/
  90.  
  91. enum {
  92.     mATAHeadNumber                = 0x0F,                            /* Head Number (bits 0-3) */
  93.     mATASectorSize                = 0xA0,                            /* bit 7=1; bit 5 = 01 (512 sector size) <DP4>*/
  94.     mATADriveSelect                = 0x10,                            /* Drive (0 = master, 1 = slave) */
  95.     mATALBASelect                = 0x40                            /* LBA mode bit (0 = chs, 1 = LBA)*/
  96. };
  97.  
  98. /* Task file definition ••• Status Register •••*/
  99.  
  100. enum {
  101.     bATABusy                    = 7,                            /* bit number of BSY bit*/
  102.     bATADriveReady                = 6,                            /* bit number of drive ready bit*/
  103.     bATAWriteFault                = 5,                            /* bit number of write fault bit*/
  104.     bATASeekComplete            = 4,                            /* bit number of seek complete bit*/
  105.     bATADataRequest                = 3,                            /* bit number of data request bit*/
  106.     bATADataCorrected            = 2,                            /* bit number of data corrected bit*/
  107.     bATAIndex                    = 1,                            /* bit number of index mark*/
  108.     bATAError                    = 0,                            /* bit number of error bit*/
  109.     mATABusy                    = 1 << bATABusy,                /* Unit is busy*/
  110.     mATADriveReady                = 1 << bATADriveReady,            /* Unit is ready*/
  111.     mATAWriteFault                = 1 << bATAWriteFault,            /* Unit has a write fault condition*/
  112.     mATASeekComplete            = 1 << bATASeekComplete,        /* Unit seek complete*/
  113.     mATADataRequest                = 1 << bATADataRequest,            /* Unit data request*/
  114.     mATADataCorrected            = 1 << bATADataCorrected,        /* Data corrected*/
  115.     mATAIndex                    = 1 << bATAIndex,                /* Index mark - NOT USED*/
  116.     mATAError                    = 1 << bATAError                /* Error condition - see error register*/
  117. };
  118.  
  119. /* ATA Command Opcode definition*/
  120.  
  121. enum {
  122.     kATAcmdWORetry                = 0x01,                            /* Without I/O retry option*/
  123.     kATAcmdNOP                    = 0x0000,                        /* NOP operation - media detect*/
  124.     kATAcmdRecal                = 0x0010,                        /* Recalibrate command */
  125.     kATAcmdRead                    = 0x0020,                        /* Read command */
  126.     kATAcmdReadLong                = 0x0022,                        /* Read Long command*/
  127.     kATAcmdWrite                = 0x0030,                        /* Write command */
  128.     kATAcmdWriteLong            = 0x0032,                        /* Write Long*/
  129.     kATAcmdReadVerify            = 0x0040,                        /* Read Verify command */
  130.     kATAcmdFormatTrack            = 0x0050,                        /* Format Track command */
  131.     kATAcmdSeek                    = 0x0070,                        /* Seek command */
  132.     kATAcmdDiagnostic            = 0x0090,                        /* Drive Diagnostic command */
  133.     kATAcmdInitDrive            = 0x0091,                        /* Init drive parameters command */
  134.     kATAcmdReadMultiple            = 0x00C4,                        /* Read multiple*/
  135.     kATAcmdWriteMultiple        = 0x00C5,                        /* Write multiple*/
  136.     kATAcmdSetRWMultiple        = 0x00C6,                        /* Set Multiple for Read/Write Multiple*/
  137.     kATAcmdReadDMA                = 0x00C8,                        /* Read DMA (with retries)*/
  138.     kATAcmdWriteDMA                = 0x00CA,                        /* Write DMA (with retries)*/
  139.     kATAcmdMCAcknowledge        = 0x00DB,                        /* Acknowledge media change - removable*/
  140.     kATAcmdStandbyImmed            = 0x00E0,                        /* Standby Immediate*/
  141.     kATAcmdIdleImmed            = 0x00E1,                        /* Idle Immediate*/
  142.     kATAcmdStandby                = 0x00E2,                        /* Standby*/
  143.     kATAcmdIdle                    = 0x00E3,                        /* Idle*/
  144.     kATAcmdReadBuffer            = 0x00E4,                        /* Read sector buffer command */
  145.     kATAcmdCheckPowerMode        = 0x00E5,                        /* Check power mode command    <04/04/94>*/
  146.     kATAcmdSleep                = 0x00E6,                        /* Sleep*/
  147.     kATAcmdWriteBuffer            = 0x00E8,                        /* Write sector buffer command */
  148.     kATAcmdDriveIdentify        = 0x00EC,                        /* Identify Drive command */
  149.     kATAcmdSetFeatures            = 0x00EF                        /* Set Features*/
  150. };
  151.  
  152. /* Set feature command opcodes*/
  153.  
  154. enum {
  155.     kATAEnableWriteCache        = 0x02,                            /*        Enable write cache*/
  156.     kATASetTransferMode            = 0x03,                            /*        Set transfer mode*/
  157.     kATASetPIOMode                = 0x08,                            /*        PIO Flow Control Tx Mode bit*/
  158.     kATAEnableECC                = 0x88,                            /*        ECC enable*/
  159.     kATAEnableRetry                = 0x99,                            /*        Retry enable*/
  160.     kATAEnableReadAhead            = 0xAA                            /*        Read look-ahead enable*/
  161. };
  162.  
  163. /* ATA Device ID codes*/
  164.  
  165. enum {
  166.     kATAInvalidDeviceID            = -1,
  167.     kATAMasterDeviceID            = 0,
  168.     kATASlaveDeviceID            = 1
  169. };
  170.  
  171. /* Device Register Images  (8 bytes) */
  172. struct ataTaskFile {
  173.     UInt8                             ataTFFeatures;                /* <-> Error(R) or ataTFFeatures(W) register image */
  174.     UInt8                             ataTFCount;                    /* <-> Sector count/remaining */
  175.     UInt8                             ataTFSector;                /* <-> Sector start/finish */
  176.     UInt8                             ataTFReserved;                /* reserved                    */
  177.     UInt16                             ataTFCylinder;                /* <-> ataTFCylinder (Big endian) */
  178.     UInt8                             ataTFSDH;                    /* <-> ataTFSDH register image*/
  179.     UInt8                             ataTFCommand;                /* <-> Status(R) or Command(W) register image */
  180. };
  181. typedef struct ataTaskFile ataTaskFile;
  182.  
  183. /* ATA Manager Function Code Definition*/
  184.  
  185. enum {
  186.     kATAMgrNOP                    = 0x00,                            /* No Operation*/
  187.     kATAMgrExecIO                = 0x01,                            /* Execute ATA I/O*/
  188.     kATAMgrBusInquiry            = 0x03,                            /* Bus Inquiry*/
  189.     kATAMgrQRelease                = 0x04,                            /* I/O Queue Release*/
  190.     kATAMgrAbort                = 0x10,                            /* Abort command*/
  191.     kATAMgrBusReset                = 0x11,                            /* Reset ATA bus*/
  192.     kATAMgrRegAccess            = 0x12,                            /* Register Access*/
  193.     kATAMgrDriveIdentify        = 0x13,                            /* Drive Identify            <DP03/10/94>*/
  194.     kATAMgrDriverLoad            = 0x82,                            /* Load driver from either Media, ROM, etc.*/
  195.     kATAMgrDriveRegister        = 0x85,                            /* Register a driver        <4/18/94>*/
  196.     kATAMgrFindDriverRefnum        = 0x86,                            /* lookup a driver refnum    <4/18/94>*/
  197.     kATAMgrRemoveDriverRefnum    = 0x87,                            /* De-register a driver    <4/18/94>*/
  198.     kATAMgrModifyEventMask        = 0x88,                            /* Modify driver event mask*/
  199.     kATAMgrDriveEject            = 0x89,                            /* Eject the drive        <8/1/94>*/
  200.     kATAMgrGetDrvConfiguration    = 0x8A,                            /* Get device configuration    <8/6/94>*/
  201.     kATAMgrSetDrvConfiguration    = 0x8B,                            /* Set device configuration <8/6/94>*/
  202.     kATAMgrGetLocationIcon        = 0x8C,                            /* Get card location icon    <SM4>*/
  203.     kATAMgrManagerInquiry        = 0x90,                            /* Manager Inquiry*/
  204.     kATAMgrManagerInit            = 0x91,                            /* Manager initialization*/
  205.     kATAMgrManagerShutdown        = 0x92,                            /* Manager ShutDown*/
  206.                                                                 /* note: functions 0x93 to 0x97 are reserved*/
  207.     kATAMgrNextAvailable        = 0x98
  208. };
  209.  
  210. /* 'ATAFlags' field of the PB header definition*/
  211.  
  212. enum {
  213.     bATAFlagUseConfigSpeed        = 15,                            /* bit number of use default speed flag*/
  214.     bATAFlagByteSwap            = 14,                            /* bit number of byte swap flag*/
  215.     bATAFlagIORead                = 13,                            /* bit number of I/O read flag*/
  216.     bATAFlagIOWrite                = 12,                            /* bit number of I/O write flag*/
  217.     bATAFlagImmediate            = 11,                            /* bit number of immediate flag*/
  218.     bATAFlagQLock                = 10,                            /* bit number of que lock on error*/
  219.     bATAFlagScatterGather1        = 9,                            /* bit number of scatter gather*/
  220.     bATAFlagScatterGather0        = 8,                            /* bit numbers of scatter gather*/
  221.     bATAFlagUseDMA                = 7,                            /* bit number of use DMA flag*/
  222.     bATAFlagProtocol1            = 5,                            /* bit number of scatter gather*/
  223.     bATAFlagProtocol0            = 4,                            /* bit numbers of protocol specifier*/
  224.     bATAFlagTFRead                = 3,                            /* bit number of register update*/
  225.     bATAFlagLEDEnable            = 0,                            /* bit number of LED enable*/
  226.     mATAFlagUseConfigSpeed        = 1 << bATAFlagUseConfigSpeed,
  227.     mATAFlagByteSwap            = 1 << bATAFlagByteSwap,        /* Swap data bytes (read - after; write - before)*/
  228.     mATAFlagIORead                = 1 << bATAFlagIORead,            /* Read (in) operation*/
  229.     mATAFlagIOWrite                = 1 << bATAFlagIOWrite,            /* Write (out) operation*/
  230.     mATAFlagImmediate            = 1 << bATAFlagImmediate,        /* Head of Que; Immediate operation*/
  231.     mATAFlagQLock                = 1 << bATAFlagQLock,            /* Manager queue lock on error (freeze the queue)*/
  232.     mATAFlagScatterGather1        = 1 << bATAFlagScatterGather1,
  233.     mATAFlagScatterGather0        = 1 << bATAFlagScatterGather0,    /* Scatter gather enable*/
  234.     mATAFlagScatterGathers        = mATAFlagScatterGather1 + mATAFlagScatterGather0, /* host scatter gather type = currently type 1 supported*/
  235.     mATAFlagUseDMA                = 1 << bATAFlagUseDMA,
  236.     mATAFlagProtocol1            = 1 << bATAFlagProtocol1,        /* ATAPI protocol indicator <06/15/94>*/
  237.     mATAFlagProtocol0            = 1 << bATAFlagProtocol0,        /* PCMCIA protocol indicator <06/15/94>*/
  238.     mATAFlagProtocols            = mATAFlagProtocol1 + mATAFlagProtocol0, /* mask for protocol type field    <06/15/94>*/
  239.     mATAFlagTFRead                = 1 << bATAFlagTFRead,            /* update reg block request upon detection of an error*/
  240.     mATAFlagLEDEnable            = 1 << bATAFlagLEDEnable        /* socket LED enable*/
  241. };
  242.  
  243. /* Parameter block header definition - common for all PBs (48 bytes)*/
  244. typedef struct ataPBHeader ataPBHeader;
  245. struct ataPBHeader {
  246.                                                                 /* Start of cloned common header ataPBHdr */
  247.     struct ataPBHeader *            ataPBLink;                    /* a pointer to the next entry in the queue    */
  248.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  249.     UInt8                             ataPBVers;                    /* -->: parameter block version number*/
  250.     UInt8                             ataPBReserved;                /* Reserved                                        */
  251.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  252.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  253.     OSErr                             ataPBResult;                /* <--: Returned result                */
  254.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  255.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  256.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  257.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  258.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  259.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  260.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  261.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  262.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  263.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  264.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  265.                                                                 /* End of cloned common header ataPBHdr*/
  266. };
  267. typedef struct ataPBHeader ataPBHeader;
  268.  
  269. /* data request entry structure (16 bytes)*/
  270. struct IOBlock {
  271.     UInt8 *                            ataPBBuffer;                /* -->: Data buffer pointer*/
  272.     UInt32                             ataPBByteCount;                /* -->: Data transfer length in bytes*/
  273. };
  274. typedef struct IOBlock IOBlock;
  275.  
  276. /*
  277.  For ATAPI devices the ExtendedPB field is a pointer to the Command Packet
  278.  record which exists of an array of words structured as follows…    <06/15/94>
  279. */
  280. struct ATAPICmdPacket {
  281.     SInt16                             atapiPacketSize;            /* Size of command packet in bytes    <06/15/94>*/
  282.     SInt16                             atapiCommandByte[8];        /* The command packet itself    <06/15/94>*/
  283. };
  284. typedef struct ATAPICmdPacket ATAPICmdPacket;
  285.  
  286. /* Manager parameter block structure (96 bytes)*/
  287. struct ataIOPB {
  288.                                                                 /* Start of cloned common header ataPBHdr*/
  289.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  290.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  291.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  292.     UInt8                             ataPBReserved;                /* Reserved                                        */
  293.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  294.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  295.     OSErr                             ataPBResult;                /* <--: Returned result                */
  296.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  297.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  298.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  299.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  300.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  301.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  302.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  303.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  304.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  305.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  306.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  307.                                                                 /* End of cloned common header ataPBHdr*/
  308.     SInt8                             ataPBStatusRegister;        /* <--: Last ATA status image*/
  309.     SInt8                             ataPBErrorRegister;            /* <--: Last ATA error image-valid if lsb of Status set*/
  310.     SInt16                             ataPBReserved5;                /* Reserved*/
  311.     UInt32                             ataPBLogicalBlockSize;        /* -->: Blind transfer size per interrupt (Logical block size)*/
  312.     UInt8 *                            ataPBBuffer;                /* -->: Data buffer pointer*/
  313.     UInt32                             ataPBByteCount;                /* -->: Data transfer length in bytes*/
  314.     UInt32                             ataPBActualTxCount;            /* <--: Actual transfer count*/
  315.     UInt32                             ataPBReserved6;                /* Reserved*/
  316.     ataTaskFile                     ataPBTaskFile;                /* <->:    Device register images*/
  317.     ATAPICmdPacket *                ataPBPacketPtr;                /* -->: ATAPI packet command block pointer (valid with ATAPI bit set)*/
  318.     SInt16                             ataPBReserved7[6];            /* Reserved for future expansion*/
  319. };
  320. typedef struct ataIOPB ataIOPB;
  321.  
  322. /*
  323.  Parameter block structure for bus and Manager inquiry command
  324.  Manager parameter block structure
  325. */
  326. struct ataBusInquiry {
  327.                                                                 /* Start of cloned common header ataPBHdr*/
  328.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  329.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  330.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  331.     UInt8                             ataPBReserved;                /* Reserved                                        */
  332.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  333.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  334.     OSErr                             ataPBResult;                /* <--: Returned result                */
  335.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  336.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  337.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  338.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  339.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  340.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  341.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  342.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  343.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  344.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  345.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  346.                                                                 /* End of cloned common header ataPBHdr*/
  347.     UInt16                             ataEngineCount;                /* <--: TBD; zero for now*/
  348.     UInt16                             ataReserved1;                /* Reserved*/
  349.     UInt32                             ataDataTypes;                /* <--: TBD; zero for now*/
  350.     UInt16                             ataIOpbSize;                /* <--: Size of ATA IO PB*/
  351.     UInt16                             ataMaxIOpbSize;                /* <--: TBD; zero for now*/
  352.     UInt32                             ataFeatureFlags;            /* <--: TBD*/
  353.     UInt8                             ataVersionNum;                /* <--: Version number for the HBA*/
  354.     UInt8                             ataHBAInquiry;                /* <--: TBD; zero for now*/
  355.     UInt16                             ataReserved2;                /* Reserved*/
  356.     UInt32                             ataHBAPrivPtr;                /* <--: Ptr to HBA private data area*/
  357.     UInt32                             ataHBAPrivSize;                /* <--: Size of HBA private data area*/
  358.     UInt32                             ataAsyncFlags;                /* <--: Event capability for callback*/
  359.     UInt8                             ataPIOModes;                /* <--: PIO modes supported (bit-significant)*/
  360.     UInt8                             ataReserved3;                /* Reserved*/
  361.     UInt8                             ataSingleDMAModes;            /* <--: Single Word DMA modes supported (b-sig)    */
  362.     UInt8                             ataMultiDMAModes;            /* <--: Multiword DMA modes supported (b-sig)*/
  363.     UInt32                             ataReserved4[4];            /* Reserved*/
  364.     SInt8                             ataReserved5[16];            /* TBD*/
  365.     SInt8                             ataHBAVendor[16];            /* <--: Vendor ID of the HBA*/
  366.     SInt8                             ataContrlFamily[16];        /* <--: Family of ATA Controller*/
  367.     SInt8                             ataContrlType[16];            /* <--: Model number of controller*/
  368.     SInt8                             ataXPTversion[4];            /* <--: version number of XPT*/
  369.     SInt8                             ataReserved6[4];            /* Reserved*/
  370.     SInt8                             ataHBAversion[4];            /* <--: version number of HBA*/
  371.     UInt8                             ataHBAslotType;                /* <--: type of slot*/
  372.     UInt8                             ataHBAslotNum;                /* <--: slot number of the HBA*/
  373.     UInt16                             ataReserved7;                /* Reserved*/
  374.     UInt32                             ataReserved8;                /* Reserved*/
  375. };
  376. typedef struct ataBusInquiry ataBusInquiry;
  377.  
  378. /* Manager parameter block structure*/
  379. struct ataMgrInquiry {
  380.                                                                 /* Start of cloned common header ataPBHdr*/
  381.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  382.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  383.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  384.     UInt8                             ataPBReserved;                /* Reserved                                        */
  385.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  386.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  387.     OSErr                             ataPBResult;                /* <--: Returned result                */
  388.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  389.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  390.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  391.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  392.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  393.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  394.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  395.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  396.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  397.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  398.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  399.                                                                 /* End of cloned common header ataPBHdr*/
  400.     NumVersion                         ataMgrVersion;                /* Manager Version information*/
  401.     UInt8                             ataMgrPBVers;                /* <--: Manager PB version number supported*/
  402.     UInt8                             Reserved1;                    /* Reserved*/
  403.     UInt16                             ataBusCnt;                    /* <--: Number of ATA buses in the system*/
  404.     UInt16                             ataDevCnt;                    /* <--: Total number of ATA devices detected*/
  405.     UInt8                             ataPioModes;                /* <--: Maximum Programmed I/O speed mode supported*/
  406.     UInt8                             Reserved2;                    /* Reserved*/
  407.     UInt16                             ataIOClkResolution;            /* <--: IO Clock resolution in nsec (Not supported)*/
  408.     UInt8                             ataSingleDMAModes;            /* <--: Single Word DMA modes supported    */
  409.     UInt8                             ataMultiDMAModes;            /* <--: Multiword DMA modes supported*/
  410.     SInt16                             Reserved[16];                /* Reserved for future expansion*/
  411. };
  412. typedef struct ataMgrInquiry ataMgrInquiry;
  413.  
  414. /*
  415.  Parameter block structure for Abort command
  416.  Manager parameter block structure
  417. */
  418. struct ataAbort {
  419.                                                                 /* Start of cloned common header ataPBHdr*/
  420.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  421.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  422.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  423.     UInt8                             ataPBReserved;                /* Reserved                                        */
  424.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  425.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  426.     OSErr                             ataPBResult;                /* <--: Returned result                */
  427.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  428.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  429.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  430.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  431.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  432.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  433.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  434.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  435.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  436.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  437.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  438.                                                                 /* End of cloned common header ataPBHdr*/
  439.     ataIOPB *                        ataAbortPB;                    /* -->: Parameter block to be aborted*/
  440.     SInt16                             Reserved[22];                /* Reserved for future expansion*/
  441. };
  442. typedef struct ataAbort ataAbort;
  443.  
  444. /* Manager parameter block structure*/
  445. struct ATAEventRec {
  446.     UInt16                             ataEventCode;                /* --> ATA event code*/
  447.     UInt16                             ataPhysicalID;                /* --> Physical drive reference*/
  448.     SInt32                             ataDrvrContext;                /* Context pointer saved by driver*/
  449. };
  450. typedef struct ATAEventRec ATAEventRec;
  451.  
  452. typedef ATAEventRec *ATAEventRecPtr;
  453. typedef pascal SInt16 (*ATAClientProcPtr)(ATAEventRecPtr ataERPtr);
  454.  
  455. #if GENERATINGCFM
  456. typedef UniversalProcPtr ATAClientUPP;
  457. #else
  458. typedef ATAClientProcPtr ATAClientUPP;
  459. #endif
  460.  
  461. enum {
  462.     uppATAClientProcInfo = kPascalStackBased
  463.          | RESULT_SIZE(SIZE_CODE(sizeof(SInt16)))
  464.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ATAEventRecPtr)))
  465. };
  466.  
  467. #if GENERATINGCFM
  468. #define NewATAClientProc(userRoutine)        \
  469.         (ATAClientUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppATAClientProcInfo, GetCurrentArchitecture())
  470. #else
  471. #define NewATAClientProc(userRoutine)        \
  472.         ((ATAClientUPP) (userRoutine))
  473. #endif
  474.  
  475. #if GENERATINGCFM
  476. #define CallATAClientProc(userRoutine, ataERPtr)        \
  477.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppATAClientProcInfo, (ataERPtr))
  478. #else
  479. #define CallATAClientProc(userRoutine, ataERPtr)        \
  480.         (*(userRoutine))((ataERPtr))
  481. #endif
  482. /*
  483.  Parameter block structure for Driver Register command
  484.  Manager parameter block structure
  485. */
  486. struct ataDrvrRegister {
  487.                                                                 /* Start of cloned common header ataPBHdr*/
  488.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  489.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  490.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  491.     UInt8                             ataPBReserved;                /* Reserved                                        */
  492.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  493.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  494.     OSErr                             ataPBResult;                /* <--: Returned result                */
  495.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  496.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  497.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  498.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  499.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  500.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  501.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  502.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  503.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  504.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  505.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  506.                                                                 /* End of cloned common header ataPBHdr*/
  507.     SInt16                             ataDrvrRefNum;                /* <->: Driver reference number*/
  508.     UInt16                             ataDrvrFlags;                /* -->: 1 = loader driver if ataPBDeviceID = -1 {PB2}*/
  509.     UInt16                             ataDeviceNextID;            /* <--: used to specified the next drive ID*/
  510.     SInt16                             ataDrvrLoadPriv;            /* Driver loader private storage*/
  511.     ATAClientUPP                     ataEventHandler;            /* <->: Pointer to ATA event callback routine {PB2}*/
  512.     SInt32                             ataDrvrContext;                /* <->: Context data saved by driver {PB2}*/
  513.     SInt32                             ataEventMask;                /* <->: Set to 1 for notification of event {PB2}*/
  514.     SInt16                             Reserved[14];                /* Reserved for future expansion - from [21] {PB2}*/
  515. };
  516. typedef struct ataDrvrRegister ataDrvrRegister;
  517.  
  518. /* Parameter block structure for Modify driver event mask command*/
  519. struct ataModifyEventMask {
  520.                                                                 /* Start of cloned common header ataPBHdr*/
  521.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  522.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  523.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  524.     UInt8                             ataPBReserved;                /* Reserved                                        */
  525.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  526.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  527.     OSErr                             ataPBResult;                /* <--: Returned result                */
  528.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  529.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  530.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  531.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  532.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  533.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  534.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  535.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  536.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  537.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  538.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  539.                                                                 /* End of cloned common header ataPBHdr*/
  540.     SInt32                             ataModifiedEventMask;        /* -->: new event mask value*/
  541.     SInt16                             Reserved[22];                /* Reserved for future expansion*/
  542. };
  543. typedef struct ataModifyEventMask ataModifyEventMask;
  544.  
  545. /* 'ataRegMask' field of the ataRegAccess definition*/
  546.  
  547. enum {
  548.     bATAAltSDevCValid            = 14,                            /* bit number of alternate status/device cntrl valid bit*/
  549.     bATAStatusCmdValid            = 7,                            /* bit number of status/command valid bit*/
  550.     bATASDHValid                = 6,                            /* bit number of ataTFSDH valid bit*/
  551.     bATACylinderHiValid            = 5,                            /* bit number of cylinder high valid bit*/
  552.     bATACylinderLoValid            = 4,                            /* bit number of cylinder low valid bit*/
  553.     bATASectorNumValid            = 3,                            /* bit number of sector number valid bit*/
  554.     bATASectorCntValid            = 2,                            /* bit number of sector count valid bit*/
  555.     bATAErrFeaturesValid        = 1,                            /* bit number of error/features valid bit*/
  556.     bATADataValid                = 0,                            /* bit number of data valid bit*/
  557.     mATAAltSDevCValid            = 1 << bATAAltSDevCValid,        /* alternate status/device control valid*/
  558.     mATAStatusCmdValid            = 1 << bATAStatusCmdValid,        /* status/command valid*/
  559.     mATASDHValid                = 1 << bATASDHValid,            /* ataTFSDH valid*/
  560.     mATACylinderHiValid            = 1 << bATACylinderHiValid,        /* cylinder high valid*/
  561.     mATACylinderLoValid            = 1 << bATACylinderLoValid,        /* cylinder low valid*/
  562.     mATASectorNumValid            = 1 << bATASectorNumValid,        /* sector number valid*/
  563.     mATASectorCntValid            = 1 << bATASectorCntValid,        /* sector count valid*/
  564.     mATAErrFeaturesValid        = 1 << bATAErrFeaturesValid,    /* error/features valid*/
  565.     mATADataValid                = 1 << bATADataValid            /* data valid*/
  566. };
  567.  
  568. /* Parameter block structure for device register access command*/
  569. union ataRegValueUnion {
  570.     UInt8                             ataByteRegValue;            /* <->: Byte register value read or to be written*/
  571.     UInt16                             ataWordRegValue;            /* <->: Word register value read or to be written*/
  572. };
  573. typedef union ataRegValueUnion ataRegValueUnion;
  574.  
  575. /* Manager parameter block structure*/
  576. struct ataRegAccess {
  577.                                                                 /* Start of cloned common header ataPBHdr*/
  578.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  579.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  580.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  581.     UInt8                             ataPBReserved;                /* Reserved                                        */
  582.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  583.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  584.     OSErr                             ataPBResult;                /* <--: Returned result                */
  585.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  586.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  587.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  588.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  589.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  590.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  591.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  592.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  593.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  594.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  595.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  596.                                                                 /* End of cloned common header ataPBHdr*/
  597.     UInt16                             ataRegSelect;                /* -->: Device Register Selector*/
  598.                                                                 /*            DataReg            0    */
  599.                                                                 /*            ErrorReg(R) or FeaturesReg(W)    1*/
  600.                                                                 /*            SecCntReg        2*/
  601.                                                                 /*            SecNumReg        3*/
  602.                                                                 /*            CylLoReg        4*/
  603.                                                                 /*            CylHiReg        5*/
  604.                                                                 /*            SDHReg            6*/
  605.                                                                 /*            StatusReg(R) or CmdReg(W)        7*/
  606.                                                                 /*            AltStatus(R) or DevCntr(W)    0E*/
  607.     ataRegValueUnion                 ataRegValue;
  608.                                                                 /* Following fields are valid only if ataRegSelect = 0xFFFF*/
  609.     UInt16                             ataRegMask;                    /* -->: mask for register(s) to update*/
  610.                                                                 /*        bit 0 : data register valid*/
  611.                                                                 /*        bit 1 : error/feaures register valid*/
  612.                                                                 /*        bit 2 : sector count register valid*/
  613.                                                                 /*        bit 3 : sector number register valid*/
  614.                                                                 /*        bit 4 : cylinder low register valid*/
  615.                                                                 /*        bit 5 : cylinder high register valid*/
  616.                                                                 /*        bit 6 : ataTFSDH register valid*/
  617.                                                                 /*        bit 7 : status/command register valid*/
  618.                                                                 /*        bits 8 - 13 : reserved (set to 0)*/
  619.                                                                 /*        bit 14: alternate status / device control reg valid*/
  620.                                                                 /*         bit 15: reserved (set to 0)*/
  621.     ataTaskFile                     ataRegisterImage;            /* <->: register images*/
  622.     UInt8                             ataAltSDevCReg;                /* <->: Alternate status(R) or Device Control(W) register image*/
  623.     UInt8                             Reserved3;                    /* Reserved*/
  624.     SInt16                             Reserved[16];                /* Reserved for future expansion*/
  625. };
  626. typedef struct ataRegAccess ataRegAccess;
  627.  
  628. /* Manager parameter block structure    <DP03/10/94>*/
  629. struct ataIdentify {
  630.                                                                 /* Start of cloned common header ataPBHdr*/
  631.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  632.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  633.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  634.     UInt8                             ataPBReserved;                /* Reserved                                        */
  635.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  636.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  637.     OSErr                             ataPBResult;                /* <--: Returned result                */
  638.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  639.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  640.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  641.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  642.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  643.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  644.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  645.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  646.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  647.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  648.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  649.                                                                 /* End of cloned common header ataPBHdr*/
  650.     UInt16                             Reserved1[4];                /* Reserved.  These are used internally by the Manager*/
  651.     UInt8 *                            ataPBBuffer;                /* Buffer for the identify data (512 bytes)*/
  652.     UInt16                             Reserved2[12];                /* Used internally by the ATA Manager*/
  653.     SInt16                             Reserved3[6];                /* Reserved for future expansion*/
  654. };
  655. typedef struct ataIdentify ataIdentify;
  656.  
  657. /* 'ataConfigSetting' field of the Get/Set Device Configuration definition <8/6/94>*/
  658.  
  659. enum {
  660.     ATAPIpacketDRQ_bit            = 6,                            /* bit number of ATAPI command packet DRQ option*/
  661.     ATAPIpacketDRQ                = 1 << ATAPIpacketDRQ_bit        /* ATAPI command packet DRQ option*/
  662. };
  663.  
  664. /* atapcValid field definition*/
  665.  
  666. enum {
  667.     bATApcAccessMode            = 0,
  668.     bATApcVcc                    = 1,
  669.     bATApcVpp1                    = 2,
  670.     bATApcVpp2                    = 3,
  671.     bATApcStatus                = 4,
  672.     bATApcPin                    = 5,
  673.     bATApcCopy                    = 6,
  674.     bATApcConfigIndex            = 7,
  675.     bATApcLockUnlock            = 15,
  676.     mATApcAccessMode            = 1 << bATApcAccessMode,
  677.     mATApcVcc                    = 1 << bATApcVcc,
  678.     mATApcVpp1                    = 1 << bATApcVpp1,
  679.     mATApcVpp2                    = 1 << bATApcVpp2,
  680.     mATApcStatus                = 1 << bATApcStatus,
  681.     mATApcPin                    = 1 << bATApcPin,
  682.     mATApcCopy                    = 1 << bATApcCopy,
  683.     mATApcConfigIndex            = 1 << bATApcConfigIndex,
  684.     mATApcLockUnlock            = 1 << bATApcLockUnlock
  685. };
  686.  
  687. /* Device physical type & socket type indicator definition*/
  688.  
  689. enum {
  690.     kATADeviceUnknown            = 0x00,                            /* no device or type undetermined*/
  691.     kATADeviceATA                = 0x01,                            /* traditional ATA protocol device <7/29/94>*/
  692.     kATADeviceATAPI                = 0x02,                            /* ATAPI protocol device    <7/29/94>*/
  693.     kATADevicePCMCIA            = 0x03,                            /* PCMCIA ATA device        <7/29/94>*/
  694.     kATASocketInternal            = 0x01,                            /* Internal ATA socket*/
  695.     kATASocketMB                = 0x02,                            /* Media Bay socket*/
  696.     kATASocketPCMCIA            = 0x03,                            /* PCMCIA socket*/
  697.     kATAConfigReserved            = 7                                /* number of reserved words at the end*/
  698. };
  699.  
  700. /*
  701.  Get/Set Device Configuration parameter block structure <8/6/94>
  702.  Manager parameter block structure
  703. */
  704. struct ataDevConfiguration {
  705.                                                                 /* Start of cloned common header ataPBHdr*/
  706.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  707.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  708.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  709.     UInt8                             ataPBReserved;                /* Reserved                                        */
  710.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  711.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  712.     OSErr                             ataPBResult;                /* <--: Returned result                */
  713.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  714.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  715.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  716.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  717.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  718.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  719.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  720.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  721.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  722.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  723.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  724.                                                                 /* End of cloned common header ataPBHdr*/
  725.     SInt32                             ataConfigSetting;            /* <->: Configuration setting*/
  726.                                                                 /*      Bits 3 - 0: Reserved*/
  727.                                                                 /*      Bit 4: Reserved (allowLBAAccess)*/
  728.                                                                 /*      Bit 5: Reserved (allowRWMultiple)*/
  729.                                                                 /*      Bit 6: ATAPIpacketDRQ*/
  730.                                                                 /*        1 = Check for Interrupt DRQ on ATAPI command packet DRQ*/
  731.                                                                 /*        0 = Default: Check only for the assertion of command packet DRQ*/
  732.                                                                 /*      Bits 31 - 7: Reserved*/
  733.     UInt8                             ataPIOSpeedMode;            /* <->: Device access speed in PIO Mode*/
  734.     UInt8                             Reserved3;                    /* Reserved to force word alignment*/
  735.     UInt16                             atapcValid;                    /* <->: Set when pcXXX fields are valid (atapcAccessMode - atapcConfigIndex)*/
  736.                                                                 /*        bit 0 - atapcAccessMode field valid, when set*/
  737.                                                                 /*        bit 1 - atapcVcc field valid, when set*/
  738.                                                                 /*        bit 2 - atapcVpp1 field valid, when set*/
  739.                                                                 /*        bit 3 - atapcVpp2 field valid, when set*/
  740.                                                                 /*        bit 4 - atapcStatus field valid, when set*/
  741.                                                                 /*        bit 5 - atapcPin field valid, when set*/
  742.                                                                 /*        bit 6 - atapcCopy field valid, when set*/
  743.                                                                 /*        bit 7 - atapcConfigIndex field valid, when set*/
  744.                                                                 /*        bits 14-8 - Reserved*/
  745.                                                                 /*        bit 15 - device lock/unlock request (write only)*/
  746.     UInt16                             ataRWMultipleCount;            /* Reserved for future (not supported yet)*/
  747.     UInt16                             ataSectorsPerCylinder;        /* Reserved for future (not supported yet)*/
  748.     UInt16                             ataHeads;                    /* Reserved for future (not supported yet)*/
  749.     UInt16                             ataSectorsPerTrack;            /* Reserved for future (not supported yet)*/
  750.     UInt16                             ataSocketNumber;            /* <--: Socket number used by the CardServices*/
  751.                                                                 /*        0xFF = socket number invalid (Not a CardServices device)*/
  752.                                                                 /*        other = socket number of the device*/
  753.     UInt8                             ataSocketType;                /* <--: Specifies the socket type (get config only)*/
  754.                                                                 /*        00 = Unknown socket*/
  755.                                                                 /*         01 = Internal ATA bus*/
  756.                                                                 /*        02 = Media Bay*/
  757.                                                                 /*        03 = PCMCIA*/
  758.     UInt8                             ataDeviceType;                /* <--: Specifies the device type (get config only)*/
  759.                                                                 /*        00 = Unknown device*/
  760.                                                                 /*        01 = standard ATA device (HD)*/
  761.                                                                 /*        02 = ATAPI device*/
  762.                                                                 /*        03 = PCMCIA ATA device*/
  763.     UInt8                             atapcAccessMode;            /* <->: Access mode: Memory vs. I/O (PCMCIA only)*/
  764.     UInt8                             atapcVcc;                    /* <->: Voltage in tenths of a volt (PCMCIA only)*/
  765.     UInt8                             atapcVpp1;                    /* <->: Voltage in tenths of a volt (PCMCIA only)*/
  766.     UInt8                             atapcVpp2;                    /* <->: Voltage in tenths of a volt (PCMCIA only)*/
  767.     UInt8                             atapcStatus;                /* <->: Card Status register setting (PCMCIA only)*/
  768.     UInt8                             atapcPin;                    /* <->: Card Pin register setting (PCMCIA only)*/
  769.     UInt8                             atapcCopy;                    /* <->: Card Socket/Copy register setting (PCMCIA only)*/
  770.     UInt8                             atapcConfigIndex;            /* <->: Card Option register setting (PCMCIA only)*/
  771.     UInt8                             ataSingleDMASpeed;            /* <->: Single Word DMA Timing Class*/
  772.     UInt8                             ataMultiDMASpeed;            /* <->: Multiple Word DMA Timing Class*/
  773.     UInt16                             ataPIOCycleTime;            /* <->:Cycle time for PIO mode*/
  774.     UInt16                             ataMultiCycleTime;            /* <->:Cycle time for Multiword DMA mode*/
  775.     UInt16                             Reserved1[7];                /* Reserved for future*/
  776. };
  777. typedef struct ataDevConfiguration ataDevConfiguration;
  778.  
  779. /* Get Card Location Icon/Text    <SM4>*/
  780.  
  781. enum {
  782.     kATALargeIconHFS            = 0x0001,                        /* Large B&W icon with mask (HFS)*/
  783.     kATALargeIconProDOS            = 0x0081                        /* Large B&W icon with mask (ProDOS)*/
  784. };
  785.  
  786. /* Manager parameter block structure*/
  787. struct ataLocationData {
  788.                                                                 /* Start of cloned common header ataPBHdr*/
  789.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  790.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  791.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  792.     UInt8                             ataPBReserved;                /* Reserved                                        */
  793.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  794.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  795.     OSErr                             ataPBResult;                /* <--: Returned result                */
  796.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  797.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  798.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  799.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  800.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  801.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  802.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  803.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  804.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  805.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  806.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  807.                                                                 /* End of cloned common header ataPBHdr*/
  808.     SInt16                             ataIconType;                /* -->: icon type specifier*/
  809.                                                                 /*         1 = Large B&W icon with mask (256 bytes)*/
  810.                                                                 /*        0x81 = Same as 1, but ProDOS icon*/
  811.     SInt16                             ataIconReserved;            /* Reserved to be longword aligned*/
  812.     SInt8 *                            ataLocationIconPtr;            /* -->: Icon Data buffer pointer*/
  813.     SInt8 *                            ataLocationStringPtr;        /* -->: Icon String buffer pointer*/
  814.     UInt16                             Reserved1[18];                /* Reserved for future*/
  815. };
  816. typedef struct ataLocationData ataLocationData;
  817.  
  818. /* ataOSType available*/
  819.  
  820. enum {
  821.     kATAddTypeMacOS                = 0x0001                        /* Blue Mac O/S ddType value*/
  822. };
  823.  
  824. /* The parameter block definition for all other ATA Manager functions.*/
  825. struct ataGeneric {
  826.                                                                 /* Start of cloned common header ataPBHdr*/
  827.     ataPBHeader *                    ataPBLink;                    /* a pointer to the next entry in the queue    */
  828.     UInt16                             ataPBQType;                    /* type byte for safety check*/
  829.     UInt8                             ataPBVers;                    /* -->: parameter block version number; Must be 0x01*/
  830.     UInt8                             ataPBReserved;                /* Reserved                                        */
  831.     Ptr                             ataPBReserved2;                /* Reserved                                        */
  832.     ProcPtr                         ataPBCallbackPtr;            /* -->: Completion Routine Pointer    */
  833.     OSErr                             ataPBResult;                /* <--: Returned result                */
  834.     UInt8                             ataPBFunctionCode;            /* -->: Manager Function Code */
  835.     UInt8                             ataPBIOSpeed;                /* -->: I/O Timing Class            */
  836.     UInt16                             ataPBFlags;                    /* -->: Various control options    */
  837.     SInt16                             ataPBReserved3;                /* Reserved                                        */
  838.     UInt32                             ataPBDeviceID;                /* -->: Device identifier            */
  839.     UInt32                             ataPBTimeOut;                /* -->: Transaction timeout value    in msec */
  840.     Ptr                             ataPBClientPtr1;            /* Client's storage Ptr 1     */
  841.     Ptr                             ataPBClientPtr2;            /* Client's storage Ptr 2     */
  842.     UInt16                             ataPBState;                    /* Reserved for Manager; Initialize to 0 */
  843.     UInt16                             ataPBSemaphores;            /* Used internally by the manager*/
  844.     SInt32                             ataPBReserved4;                /* Reserved                                        */
  845.                                                                 /* End of cloned common header ataPBHdr*/
  846.     UInt16                             Reserved[24];                /* Reserved for future*/
  847. };
  848. typedef struct ataGeneric ataGeneric;
  849.  
  850. union ataPB {
  851.     ataIOPB                         ataIOParamBlock;            /* parameter block for I/O*/
  852.     ataBusInquiry                     ataBIParamBlock;            /* parameter block for bus inquiry*/
  853.     ataMgrInquiry                     ataMIParamBlock;            /* parameter block for Manager inquiry*/
  854.     ataAbort                         ataAbortParamBlock;            /* parameter block for abort*/
  855.     ataDrvrRegister                 ataDRParamBlock;            /* parameter block for driver register*/
  856.     ataModifyEventMask                 ataMEParamBlock;            /* parameter block for event mask modify*/
  857.     ataRegAccess                     ataRAParamBlock;            /* parameter block for register access*/
  858.     ataIdentify                     ataDIParamBlock;            /* parameter block for drive identify*/
  859.     ataDevConfiguration             ataDCParamBlock;            /* parameter block for device configuration*/
  860.     ataLocationData                 ataLDParamBlock;            /* parameter block for location icon data*/
  861.                                                                 /*ataManagerInit    ataInitParamBlock;        // parameter block for Manager initialization*/
  862.                                                                 /*ataManagerShutDn    ataSDParamBlock;        // parameter block for Manager shutdown*/
  863.                                                                 /*ataDrvrLoad        ataDLParamBlock;        // parameter block for Driver loading*/
  864.     ataGeneric                         ataGenericParamBlock;        /* parameter block for all other functions*/
  865. };
  866. typedef union ataPB ataPB;
  867.  
  868. /* The ATA Event codes…*/
  869.  
  870. enum {
  871.     kATANullEvent                = 0x00,                            /* Just kidding -- nothing happened*/
  872.     kATAOnlineEvent                = 0x01,                            /* An ATA device has come online*/
  873.     kATAOfflineEvent            = 0x02,                            /* An ATA device has gone offline*/
  874.     kATARemovedEvent            = 0x03,                            /* An ATA device has been removed from the bus*/
  875.     kATAResetEvent                = 0x04,                            /* Someone gave a hard reset to the drive*/
  876.     kATAOfflineRequest            = 0x05,                            /* Someone requesting to offline the drive*/
  877.     kATAEjectRequest            = 0x06,                            /* Someone requesting to eject the drive*/
  878.     kATAUpdateEvent                = 0x07,                            /* Potential configuration change reported by CardServices <SM4>*/
  879.     kATATaskTimeRequest            = 0x08,                            /* The manager is requesting to be called at Task Time*/
  880.                                                                 /* The following describes bit definitions in the eventMask field of ataDrvrRegister*/
  881.     bATANullEvent                = 1 << kATANullEvent,            /* null event bit*/
  882.     bATAOnlineEvent                = 1 << kATAOnlineEvent,            /* online event bit*/
  883.     bATAOfflineEvent            = 1 << kATAOfflineEvent,        /* offline event bit*/
  884.     bATARemovedEvent            = 1 << kATARemovedEvent,        /* removed event bit*/
  885.     bATAResetEvent                = 1 << kATAResetEvent,            /* reset event bit*/
  886.     bATAOfflineRequest            = 1 << kATAOfflineRequest,        /* offline request event bit*/
  887.     bATAEjectRequest            = 1 << kATAEjectRequest,        /* eject request event bit*/
  888.     bATAUpdateEvent                = 1 << kATAUpdateEvent            /* configuration update event bit*/
  889. };
  890.  
  891. typedef pascal OSErr (*ATADispatchProcPtr)(ataPB *pb);
  892.  
  893. #if GENERATINGCFM
  894. typedef UniversalProcPtr ATADispatchUPP;
  895. #else
  896. typedef ATADispatchProcPtr ATADispatchUPP;
  897. #endif
  898.  
  899. enum {
  900.     uppATADispatchProcInfo = kPascalStackBased
  901.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  902.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ataPB *)))
  903. };
  904.  
  905. #if GENERATINGCFM
  906. #define NewATADispatchProc(userRoutine)        \
  907.         (ATADispatchUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppATADispatchProcInfo, GetCurrentArchitecture())
  908. #else
  909. #define NewATADispatchProc(userRoutine)        \
  910.         ((ATADispatchUPP) (userRoutine))
  911. #endif
  912.  
  913. #if GENERATINGCFM
  914. #define CallATADispatchProc(userRoutine, pb)        \
  915.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppATADispatchProcInfo, (pb))
  916. #else
  917. #define CallATADispatchProc(userRoutine, pb)        \
  918.         (*(userRoutine))((pb))
  919. #endif
  920. extern pascal SInt16 ataManager(ataPB *pb)
  921.  ONEWORDINLINE(0xAAF1);
  922.  
  923. /* Device Error codes: 0xDB42 - 0xDB5F    */
  924.  
  925. enum {
  926.     ATABaseErrCode                = -9406,                        /* Base error code - 0xDB42    */
  927.     ioPending                    = 1,                            /* Asynch I/O in progress status*/
  928.     AT_NRdyErr                    = ATABaseErrCode + 0x01,        /* 0xDB43: Drive not Ready */
  929.     AT_IDNFErr                    = ATABaseErrCode + 0x02,        /* 0xDB44: ID not found */
  930.     AT_DMarkErr                    = ATABaseErrCode + 0x03,        /* 0xDB45: Data mark not found */
  931.     AT_BadBlkErr                = ATABaseErrCode + 0x04,        /* 0xDB46: Bad Block */
  932.     AT_CorDataErr                = ATABaseErrCode + 0x05,        /* 0xDB47: Data was corrected */
  933.     AT_UncDataErr                = ATABaseErrCode + 0x06,        /* 0xDB48: Data was not corrected */
  934.     AT_SeekErr                    = ATABaseErrCode + 0x07,        /* 0xDB49: Seek error */
  935.     AT_WrFltErr                    = ATABaseErrCode + 0x08,        /* 0xDB4A: Write fault */
  936.     AT_RecalErr                    = ATABaseErrCode + 0x09,        /* 0xDB4B: Recalibrate failed */
  937.     AT_AbortErr                    = ATABaseErrCode + 0x0A,        /* 0xDB4C: Command aborted by drive */
  938.     AT_MCErr                    = ATABaseErrCode + 0x0C,        /* 0xDB4E: Media Changed error*/
  939.     ATAPICheckErr                = ATABaseErrCode + 0x0D,        /* 0xDB4F: ATAPI Check condition <06/15/94>*/
  940.                                                                 /* System error codes...Custom Driver Error Codes 0xDB60 - 0xDB6F*/
  941.     DRVRCantAllocate            = ATABaseErrCode + 0x1E,        /* 0xDB60: Allocation error during initialization*/
  942.     NoATAMgr                    = ATABaseErrCode + 0x1F,        /* 0xDB61: MgrInquiry failed => No ATA Manager*/
  943.     ATAInitFail                    = ATABaseErrCode + 0x20,        /* 0xDB62: Mgr Initialization failed*/
  944.     ATABufFail                    = ATABaseErrCode + 0x21,        /* 0xDB63: Device buffer test failure*/
  945.     ATADevUnsupported            = ATABaseErrCode + 0x22,        /* 0xDB64: Device type not supported*/
  946.     ATAEjectDrvErr                = ATABaseErrCode + 0x23,        /* 0xDB65: Could not eject the drive*/
  947.                                                                 /* Manager Error Codes 0xDB70 - 0xDB8F*/
  948.     ATAMgrNotInitialized        = ATABaseErrCode + 0x2E,        /* 0xDB70: Mgr has not been initialized*/
  949.     ATAPBInvalid                = ATABaseErrCode + 0x2F,        /* 0xDB71: The bus base address couldn't be found*/
  950.     ATAFuncNotSupported            = ATABaseErrCode + 0x30,        /* 0xDB72: An unknown function code specified*/
  951.     ATABusy                        = ATABaseErrCode + 0x31,        /* 0xDB73: Selected device is busy*/
  952.     ATATransTimeOut                = ATABaseErrCode + 0x32,        /* 0xDB74: Transaction timeout detected*/
  953.     ATAReqInProg                = ATABaseErrCode + 0x33,        /* 0xDB75: Channel busy; channel is processing another cmd*/
  954.     ATAUnknownState                = ATABaseErrCode + 0x34,        /* 0xDB76: Device status register reflects an unknown state*/
  955.     ATAQLocked                    = ATABaseErrCode + 0x35,        /* 0xDB77: I/O Queue is locked due to previous I/O error.*/
  956.     ATAReqAborted                = ATABaseErrCode + 0x36,        /* 0xDB78: The I/O queue entry was aborted due to an abort req.*/
  957.                                                                 /*            or due to Manager shutdown.*/
  958.     ATAUnableToAbort            = ATABaseErrCode + 0x37,        /* 0xDB79: The I/O queue entry could not be aborted.*/
  959.     ATAAbortedDueToRst            = ATABaseErrCode + 0x38,        /* 0xDB7A: Request aborted due to a device reset command.*/
  960.     ATAPIPhaseErr                = ATABaseErrCode + 0x39,        /* 0xDB7B: Unexpected phase - •••IS THIS VALID ERROR??? <06/15/94>*/
  961.     ATAPITxCntErr                = ATABaseErrCode + 0x3A,        /* 0xDB7C: Overrun/Underrun condition detected*/
  962.     ATANoClientErr                = ATABaseErrCode + 0x3B,        /* 0xDB7D: No client present to handle the event*/
  963.     ATAInternalErr                = ATABaseErrCode + 0x3C,        /* 0xDB7E: MagnumOpus returned an error*/
  964.     ATABusErr                    = ATABaseErrCode + 0x3D,        /* 0xDB7F: Bus error detected on I/O    */
  965.     AT_NoAddrErr                = ATABaseErrCode + 0x3E,        /* 0xDB80: Invalid AT base adress */
  966.     DriverLocked                = ATABaseErrCode + 0x3F,        /* 0xDB81: Current driver must be removed before adding another*/
  967.     CantHandleEvent                = ATABaseErrCode + 0x40,        /* 0xDB82: Particular event couldn't be handled (call others)*/
  968.     ATAMgrMemoryErr                = ATABaseErrCode + 0x41,        /* 0xDB83: Manager memory allocation error    */
  969.     ATASDFailErr                = ATABaseErrCode + 0x42,        /* 0xDB84: Shutdown failure                */
  970.     ATAXferParamErr                = ATABaseErrCode + 0x43,        /* 0xDB85: I/O xfer parameters inconsistent */
  971.     ATAXferModeErr                = ATABaseErrCode + 0x44,        /* 0xDB86: I/O xfer mode not supported */
  972.     ATAMgrConsistencyErr        = ATABaseErrCode + 0x45,        /* 0XDB87: Manager detected internal inconsistency. */
  973.     ATADmaXferErr                = ATABaseErrCode + 0x46,        /* 0XDB88: fatal error in DMA side of transfer */
  974.                                                                 /* Driver loader error Codes 0xDB90 - 0xDBA5*/
  975.     ATAInvalidDrvNum            = ATABaseErrCode + 0x4E,        /* 0xDB90: Invalid drive number from event*/
  976.     ATAMemoryErr                = ATABaseErrCode + 0x4F,        /* 0xDB91: Memory allocation error*/
  977.     ATANoDDMErr                    = ATABaseErrCode + 0x50,        /* 0xDB92: No DDM found on media    */
  978.     ATANoDriverErr                = ATABaseErrCode + 0x51            /* 0xDB93: No driver found on the media    */
  979. };
  980.  
  981. /* ------------------------    Version 1 definition -------------------------------    */
  982.  
  983. enum {
  984.     v1ATABaseErrCode            = 0x0700,                        /* This needs a home somewhere*/
  985.     v1AT_NRdyErr                = 0x01 - v1ATABaseErrCode,        /* 0xF901: -0x1DBE */
  986.     v1AT_IDNFErr                = 0x04 - v1ATABaseErrCode,        /* 0xF904: -0x1DC0 */
  987.     v1AT_DMarkErr                = 0x05 - v1ATABaseErrCode,        /* 0xF905: -0x1DC0 */
  988.     v1AT_BadBlkErr                = 0x06 - v1ATABaseErrCode,        /* 0xF906: -0x1DC0 */
  989.     v1AT_CorDataErr                = 0x07 - v1ATABaseErrCode,        /* 0xF907: -0x1DC0 */
  990.     v1AT_UncDataErr                = 0x08 - v1ATABaseErrCode,        /* 0xF908: -0x1DC0 */
  991.     v1AT_SeekErr                = 0x09 - v1ATABaseErrCode,        /* 0xF909: -0x1DC0 */
  992.     v1AT_WrFltErr                = 0x0A - v1ATABaseErrCode,        /* 0xF90A: -0x1DC0 */
  993.     v1AT_RecalErr                = 0x0B - v1ATABaseErrCode,        /* 0xF90B: -0x1DC0 */
  994.     v1AT_AbortErr                = 0x0C - v1ATABaseErrCode,        /* 0xF90C: -0x1DC0 */
  995.     v1AT_NoAddrErr                = 0x0D - v1ATABaseErrCode,        /* 0xF90D: -0x1D8D */
  996.     v1AT_MCErr                    = 0x0E - v1ATABaseErrCode,        /* 0xF90E: -0x1DC0*/
  997.                                                                 /* System error codes...Custom Driver Error Codes*/
  998.     v1DRVRCantAllocate            = -(v1ATABaseErrCode + 1),        /* 0xF8FF: -0x1D9F*/
  999.     v1NoATAMgr                    = -(v1ATABaseErrCode + 2),        /* 0xF8FE: -0x1D9D*/
  1000.     v1ATAInitFail                = -(v1ATABaseErrCode + 3),        /* 0xF8FD: -0x1D9B*/
  1001.     v1ATABufFail                = -(v1ATABaseErrCode + 4),        /* 0xF8FC: -0x1D99*/
  1002.     v1ATADevUnsupported            = -(v1ATABaseErrCode + 5),        /* 0xF8FB: -0x1c97*/
  1003.                                                                 /* Manager Error Codes*/
  1004.     v1ATAMgrNotInitialized        = -(v1ATABaseErrCode + 10),        /* 0xF8F6: -0x1D86*/
  1005.     v1ATAPBInvalid                = -(v1ATABaseErrCode + 11),        /* 0xF8F5: -0x1D84*/
  1006.     v1ATAFuncNotSupported        = -(v1ATABaseErrCode + 12),        /* 0xF8F4: -0x1D82*/
  1007.     v1ATABusy                    = -(v1ATABaseErrCode + 13),        /* 0xF8F3: -0x1D80*/
  1008.     v1ATATransTimeOut            = -(v1ATABaseErrCode + 14),        /* 0xF8F2: -0x1D7E*/
  1009.     v1ATAReqInProg                = -(v1ATABaseErrCode + 15),        /* 0xF8F1: -0x1D7C*/
  1010.     v1ATAUnknownState            = -(v1ATABaseErrCode + 16),        /* 0xF8F0: -0x1D7A*/
  1011.     v1ATAQLocked                = -(v1ATABaseErrCode + 17),        /* 0xF8EF: -0x1D78*/
  1012.     v1ATAReqAborted                = -(v1ATABaseErrCode + 18),        /* 0xF8EE: -0x1D76*/
  1013.     v1ATAUnableToAbort            = -(v1ATABaseErrCode + 19),        /* 0xF8ED: -0x1D74*/
  1014.     v1ATAAbortedDueToRst        = -(v1ATABaseErrCode + 20)        /* 0xF8EC: -0x1D72*/
  1015. };
  1016.  
  1017. #endif
  1018.  
  1019. #if PRAGMA_ALIGN_SUPPORTED
  1020. #pragma options align=reset
  1021. #endif
  1022.  
  1023. #if PRAGMA_IMPORT_SUPPORTED
  1024. #pragma import off
  1025. #endif
  1026.  
  1027. #ifdef __cplusplus
  1028. }
  1029. #endif
  1030.  
  1031. #endif /* __ATA__ */
  1032.  
  1033.